import request from '@/utils/request'

// 获取经纪
export function jingji(params) {
  return request({
    url: '/agents',
    params
  })
}
// 获取经纪数量
export function jingjiTotal() {
  return request({
    url: '/agents/count'
  })
}
// 根据id  获取经纪详情
export function getJingjiDetail(id) {
  return request({
    url: `/agents/${id}`
  })
}
// 根据id  编辑经纪详情
export function getJingjiEditor(data) {
  return request({
    url: `/agents/${data.id}`,
    method: 'put',
    data
  })
}
// 新增经纪详情
export function addJingji(data) {
  return request({
    url: `/agents`,
    method: 'post',
    data
  })
}
// 删除经纪详情
export function delJingji(id) {
  return request({
    url: `/agents/${id}`,
    method: 'delete'
  })
}
